#ifndef __demo_test_pobo_client_work_alloc_h__
#define __demo_test_pobo_client_work_alloc_h__

namespace testpobo
{
    class client_work_allocator
    {
    public:

        typedef boost::asio::ip::tcp::socket socket_type;

        client_work_allocator(LoggerPtr logger, qserv::io_service_pool& pool, utils::TrafficWatchPtr trafficWatch):
        m_logger(logger),
        m_pool(pool),
        m_trafficWatch(trafficWatch)
        {
        }

        socket_type* make_socket(boost::asio::io_service& io_service)
        {
            return new socket_type(io_service);
        }

        client_work* make_handler()
        {
            return new client_work(m_logger, boost::shared_ptr<CXmlParser>(new CXmlParser(m_pool.get_io_service(), m_logger)), m_trafficWatch);
        }

    private:
        LoggerPtr                       m_logger;
        qserv::io_service_pool&         m_pool;
        utils::TrafficWatchPtr          m_trafficWatch;
    };
}

#endif // __demo_test_pobo_client_work_alloc_h__
